package com.it135.citytraffic.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author lh
 * @since 2024-07-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("road_statistic")
@AllArgsConstructor
@NoArgsConstructor
public class RoadStatistic implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 路口id
     */
    private Integer crossingId;

    /**
     * 路段名称
     */
    private String name;

    /**
     * 方向
     */
    private String direction;

    /**
     * 0未知;  1畅通;   2缓行;    3拥堵  4严重拥堵
     */
    private Integer status;
public String  getInfo(){
    return switch (this.status) {
        case 1 -> "畅通";
        case 2 -> "缓行";
        case 3 -> "拥堵";
        case 4 -> "严重拥堵";
        default -> "未知";
    };
}

}
